package com.xsystem.api.util;

import java.util.Map;


public class ApiResponseHandler {

	protected ApiResponseHandler() {
	}

	protected String getProperty(String key, String languageCode,
			String... parameters) {
		return MessagesUtil.getProperty(this.getClass(), key, languageCode,
				parameters);
	}

	protected Map<String, Object> prepareErrorResponse(String errorCode,
			String languageCode, String... params) {
		return MessagesUtil.prepareErrorResponse(errorCode,
				getProperty(errorCode, languageCode, params));
	}

	protected Map<String, Object> prepareCustomErrorResponse(String errorCode,
			String errorMsg) {
		return MessagesUtil.prepareErrorResponse(errorCode, errorMsg);
	}

	protected Map<String, Object> prepareSuccessResponse(
			Map<String, Object> responseMap, String msg) {
		return MessagesUtil.prepareSuccessResponse(responseMap, msg);
	}

	protected Map<String, Object> prepareWarningResponse(
			Map<String, Object> responseMap, String msg) {
		return MessagesUtil.prepareWarningResponse(responseMap, msg);
	}

	protected Map<String, Object> prepareFailedResponse(
			Map<String, Object> responseMap, String errorCode, String msg) {
		return MessagesUtil.prepareFailedResponse(responseMap, errorCode, msg);

	}

}
